package com.example.demotest.repository;

import com.example.demotest.pojo.User;
import com.example.demotest.pojo.UserFollow;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface UserFollowRepository extends JpaRepository<UserFollow, Integer> {

    List<UserFollow> findByFollower(User follower);

    List<UserFollow> findByFollowing(User following);

    Optional<UserFollow> findByFollowerAndFollowing(User follower, User following);

    void deleteByFollowerAndFollowing(User follower, User following);

}